 /* UVa- 706
 * Author- Ajeet Singh
 * http://uva.onlinejudge.org
 * id- ajeet.singh82
 * Contact- ajeet.singh82@gmail.com
 *
 * 
 * Algorithm: 
 *
 *
 * Build:
 * ...
 */
#include <iostream>
#include <string>
#include <sstream>
#include <stdio.h>
using namespace std;
ostringstream os;
char num[20];
unsigned short size = 1;
string line[10][5] = {
	{" - ", "| |", "   ", "| |", " - "}, //0
	{"   ", "  |", "   ", "  |", "   "}, //1
	{" - ", "  |", " - ", "|  ", " - "}, //2
	{" - ", "  |", " - ", "  |", " - "}, //3
	{"   ", "| |", " - ", "  |", "   "}, //4
	{" - ", "|  ", " - ", "  |", " - "}, //5
	{" - ", "|  ", " - ", "| |", " - "}, //6
	{" - ", "  |", "   ", "  |", "   "}, //7
	{" - ", "| |", " - ", "| |", " - "}, //8
	{" - ", "| |", " - ", "  |", " - "} //9
};

void prepare_dc() {
	for(unsigned short l = 0;  l < 5; l++) {
		short s = size;
		string r;
		short i=0;
		while(num[i] != '\0') {
			r += line[num[i]-48][l].at(0);
			r.append(size, line[num[i]-48][l].at(1));
			r += line[num[i]-48][l].at(2);
			if(num[i+1] != '\0')
				r += " ";
			i++;
		}
		os << r << endl;
		s--;
		while ((l & 0x01) != 0 && s > 0 ) {
			os << r << endl;
			s--;
		}
	}
	os << endl;
}

/* main
 * */

int main() {
	while ( true ) {
		unsigned long n =0;
		fill(num, num+10, '\0');
		cin >> size >> n;
		if (size == 0 && n == 0) { 
			cout << os.str();
			return 0;
		}
		sprintf(num, "%lu", n);
		prepare_dc();
	}
}
